<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

$json ='{"items":[{"item_line":[{"id":1,"item_name":"Mane 1","desc":"Description 1","photos":{"mid":"middle.jpg","lar":"large.jpg"}},{"id":2,"item_name":"Mane 1","desc":"Description 1","photos":{"mid":"middle.jpg","lar":"large.jpg"}},{"id":3,"item_name":"Mane 1","desc":"Description 1","photos":{"mid":"middle.jpg","lar":"large.jpg"}}]},{"item_line":[{"id":1,"item_name":"Mane 1","desc":"Description 1","photos":{"mid":"middle.jpg","lar":"large.jpg"}},{"id":2,"item_name":"Mane 1","desc":"Description 1","photos":{"mid":"middle.jpg","lar":"large.jpg"}},{"id":3,"item_name":"Mane 1","desc":"Description 1","photos":{"mid":"middle.jpg","lar":"large.jpg"}}]}]}';

echo "<pre>";
var_dump(json_decode($json));

echo "<br>--------------------------------------";

//var_dump(json_decode($json, true));
$items =json_decode($json)->items;

for($i=0;$i<count($items);$i++){
    $item_line = $items[$i]->item_line;
    echo "<br> item_line --------------------------------------";
   var_dump($item_line);
    for($j=0;$j<count($item_line);$j++){
        $item = $item_line[$j];
         echo "<br> item --------------------------------------";
        var_dump($item);
    }
    
    
}



?>